/*
 * 易族智汇（北京）科技有限公司 版权所有。
 * 未经许可，您不得使用此文件。
 * 官方地址：www.javamall.com.cn
 */
package com.enation.app.javashop.core.client.feignimpl.payment;

import com.enation.app.javashop.client.payment.PayLogClient;
import com.enation.app.javashop.core.client.fallback.payment.PayLogClientFallbackFactory;
import com.enation.app.javashop.core.handler.FeignConfiguration;
import com.enation.app.javashop.model.trade.order.dos.PayLog;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 支付日志SDK
 *
 * @author fk create in 2020/4/7
 * @version v2.0
 * @since v7.2.0
 */
@FeignClient(name = "payment-service", fallbackFactory = PayLogClientFallbackFactory.class,configuration = {FeignConfiguration.class})
public interface PayLogClientFeignImpl extends PayLogClient {

    /**
     * 添加收款单
     * @param payLog 收款单
     * @return PayLog 收款单
     */
    @Override
    @PostMapping("/client/payment/pay-log")
    PayLog add(@RequestBody PayLog payLog);

    /**
     * 修改收款单
     * @param payLog 收款单
     * @param id 收款单主键
     * @return PayLog 收款单
     */
    @Override
    @PutMapping("/client/payment/pay-log/{id}")
    PayLog edit(@RequestBody PayLog payLog, @PathVariable("id") Long id);

    /**
     * 根据订单号
     * @param orderSn
     * @return
     */
    @Override
    @GetMapping("/client/payment/pay-log/order/{order_sn}")
    PayLog getModel(@PathVariable("order_sn") String orderSn);


}
